export default {
  namespaced: true,
  state: {
    curDate: new Date(),
    statisticCurDate: new Date(),
    buildId: '',
    dorm: {},
    attendancePerson: '',
    vuexShowMonth: true,
    attendanceType: '', // 1:出勤 2.迟到 3:早退 4：未出勤 5：请假 6其他
    curDormIndex: '0',
    monthBackOffUrl: '',
    // 考勤统计
    attendanceChartData: {},
    statisticInfo: [],
    recordParam: {},
    active: 0,
    viewBy: 'daily',
    bodyHeight: ''
  },
  getters: {
    curDate: (state) => state.curDate,
    statisticCurDate: (state) => state.statisticCurDate,
    buildId: (state) => state.buildId,
    dorm: (state) => state.dorm,
    attendancePerson: (state) => state.attendancePerson,
    vuexShowMonth: (state) => state.vuexShowMonth,
    attendanceType: (state) => state.attendanceType,
    curDormIndex: (state) => state.curDormIndex,
    monthBackOffUrl: (state) => state.monthBackOffUrl,
    attendanceChartData: (state) => state.attendanceChartData,
    statisticInfo: (state) => state.statisticInfo,
    recordParam: (state) => state.recordParam,
    active: (state) => state.active,
    viewBy: (state) => state.viewBy,
    bodyHeight: (state) => state.bodyHeight
  },
  mutations: {
    setCurDate: (state, value) => (state.curDate = value),
    setStatisticCurDate: (state, value) => (state.statisticCurDate = value),
    setBuildId: (state, value) => (state.buildId = value),
    setDorm: (state, value) => (state.dorm = value),
    setAttendancePerson: (state, value) => (state.attendancePerson = value),
    setVuexShowMonth: (state, value) => (state.vuexShowMonth = value),
    setAttendanceType: (state, value) => (state.attendanceType = value),
    setCurDormIndex: (state, value) => (state.curDormIndex = value),
    setMonthBackOffUrl: (state, value) => (state.monthBackOffUrl = value),
    initCurdate: (state) => (state.curDate = new Date()),
    setAttendanceChartData: (state, value) => (state.attendanceChartData = value),
    setStatisticInfo: (state, value) => (state.statisticInfo = value),
    setRecordParam: (state, value) => (state.recordParam = value),
    setActive: (state, value) => (state.active = value),
    setViewBy: (state, value) => (state.viewBy = value),
    setBodyHeight: (state, value) => (state.bodyHeight = value)
  },
  actions: {}
};
